package com.zzl.ov_library.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName books
 */
@TableName(value ="books")
@Data
public class Books implements Serializable {
    /**
     * 
     */
    @TableId(value = "book_id", type = IdType.AUTO)
    private Integer bookId;

    /**
     * 书名
     */
    @TableField(value = "book_title")
    private String bookTitle;

    /**
     * 
     */
    @TableField(value = "isbn")
    private String isbn;

    /**
     * 书籍类别
     */
    @TableField(value = "category")
    private String category;

    /**
     * 索书号
     */
    @TableField(value = "call_number")
    private String callNumber;

    /**
     * 出版社
     */
    @TableField(value = "book_press")
    private String bookPress;

    /**
     * 
     */
    @TableField(value = "author")
    private String author;

    /**
     * 
     */
    @TableField(value = "price")
    private Double price;

    /**
     * 
     */
    @TableField(value = "brief")
    private String brief;

    /**
     * 封面
     */
    @TableField(value = "cover")
    private String cover;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Books other = (Books) that;
        return (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBookTitle() == null ? other.getBookTitle() == null : this.getBookTitle().equals(other.getBookTitle()))
            && (this.getIsbn() == null ? other.getIsbn() == null : this.getIsbn().equals(other.getIsbn()))
            && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
            && (this.getCallNumber() == null ? other.getCallNumber() == null : this.getCallNumber().equals(other.getCallNumber()))
            && (this.getBookPress() == null ? other.getBookPress() == null : this.getBookPress().equals(other.getBookPress()))
            && (this.getAuthor() == null ? other.getAuthor() == null : this.getAuthor().equals(other.getAuthor()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getBrief() == null ? other.getBrief() == null : this.getBrief().equals(other.getBrief()))
            && (this.getCover() == null ? other.getCover() == null : this.getCover().equals(other.getCover()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBookTitle() == null) ? 0 : getBookTitle().hashCode());
        result = prime * result + ((getIsbn() == null) ? 0 : getIsbn().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getCallNumber() == null) ? 0 : getCallNumber().hashCode());
        result = prime * result + ((getBookPress() == null) ? 0 : getBookPress().hashCode());
        result = prime * result + ((getAuthor() == null) ? 0 : getAuthor().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getBrief() == null) ? 0 : getBrief().hashCode());
        result = prime * result + ((getCover() == null) ? 0 : getCover().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bookId=").append(bookId);
        sb.append(", bookTitle=").append(bookTitle);
        sb.append(", isbn=").append(isbn);
        sb.append(", category=").append(category);
        sb.append(", callNumber=").append(callNumber);
        sb.append(", bookPress=").append(bookPress);
        sb.append(", author=").append(author);
        sb.append(", price=").append(price);
        sb.append(", brief=").append(brief);
        sb.append(", cover=").append(cover);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}